import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/indexHome.vue'
import Friends from '../views/Friends/indexFriends.vue'
import Cart from '../views/Cart/indexCart.vue'
import Search from '../views/Search/indexSearch.vue'
import NoFoundPage from '../views/404/indexAdd.vue'
import layout from '../layout/indexAdd.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home',
    component: layout,
    children: [
      {
        path: '/home',
        component: Home
      },
      {
        path: '/friends',
        component: Friends
      },
      {
        path: '/cart',
        component: Cart
      },
      {
        path: '/search',
        component: Search
      }
    ]
  },
  {
    path: '*',
    component: NoFoundPage
  }
]

const router = new VueRouter({
  routes
})

export default router